<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/template/basic.jspf"%>
<script type="text/javascript" src="${ctx}/js/system/function/info.js"></script>
</head>
<body>
	<div class="wrap">
		<div class="row-fluid panel panel-default">
			<div class="panel-body">
				<div class="row-fluid">
					<form id="form" name="form" class="form-horizontal" method="post"
						action="${ctx}/function/addEntity.shtml">

						<div class="form-group">
							<label id="lbDeptName" class="col-xs-2 control-label">菜单名称</label>
							<div class="col-xs-8">
								<input type="hidden" id="functionId_"
									value="${resources.function_id}"
									name="sysResFormMap.function_id">
								<input type="hidden" value="${parentResources.level+1}"
										name="sysResFormMap.level">

								<input id="txtDeptName" maxlength="20" type="text"
									class="form-control" required-message="名称不能为空"
									check-type="required" name="SysResFormMap.function_name"
									value="${resources.function_name }" />
							</div>
						</div>
						<div class="form-group">
							<label id="lbDeptName" class="col-xs-2 control-label">菜单标识</label>
							<div class="col-xs-8">
								<input id="FunctionCode" maxlength="20" type="text"
									class="form-control" name="SysResFormMap.function_code"
									required-message="标识格式不正确" check-type="required word"
									value="${resources.function_code }" />
							</div>
						</div>

						<c:if test="${!empty function.function_name }">
							<div class="form-group">
								<label id="lbDeptName" class="col-xs-2 control-label">上级菜单</label>
								<div class="col-xs-8">
									<input id="txtParentDeptName" maxlength="20" type="text"
										class="form-control" value="${function.function_name }"
										readonly="readonly" /> <input type="hidden"
										value="${function.function_id }"
										name="sysResFormMap.parent_id">
								</div>
							</div>
						</c:if>


						<c:if test="${!empty parentResources.function_id  }">
							<div class="form-group">
								<label id="lbDeptName" class="col-xs-2 control-label">上级菜单</label>
								<div class="col-xs-8">
									<input id="txtParentDeptName" maxlength="20" type="text"
										class="form-control" value="${parentResources.function_name }"
										readonly="readonly" /> <input type="hidden"
										value="${parentResources.function_id }"
										name="sysResFormMap.parent_id">
								</div>
							</div>
						</c:if>

						<div class="form-group">
								<label class="col-xs-2 control-label">菜单类型</label>
								<div class="col-xs-8">
									<select name="sysResFormMap.function_type" class="form-control"
										disabled="disabled">
										<option value="1"
											<c:if test="${parentResources.function_type=='0'}">selected="selected"</c:if>>------目录 ------</option>
										<option value="2"
											<c:if test="${parentResources.function_type=='1'}">selected="selected"</c:if>>------菜单 ------</option>
										<option value="3"
											<c:if test="${parentResources.function_type=='2'}">selected="selected"</c:if>>------按扭 ------</option>
									</select> <input type="hidden" class="form-control checkacc"
										name="sysResFormMap.function_type" id="resUrl"
										<c:if test="${parentResources.function_type=='0'}"> value="1"</c:if>
										<c:if test="${parentResources.function_type=='1'}"> value="2"</c:if>
										<c:if test="${parentResources.function_type=='2'}"> value="3"</c:if>>
								</div>
							</div>

						<c:if test="${parentResources.function_type=='1'}">
							<div class="form-group">
								<label id="lbSequence" class="col-xs-2 control-label">菜单url</label>
								<div class="col-xs-8">
									<input id="txtSequence" maxlength="100" type="text"
										class="form-control" name="SysResFormMap.url" value="${resources.url}" />
								</div>
							</div>
						</c:if>
						<%-- <c:if test="${parentResources.function_type=='2'}">
							<div class="form-group">
								<label id="lbSequence" class="col-xs-2 control-label">菜单url</label>
								<div class="col-xs-8">
									<input id="txtSequence" maxlength="30" type="text"
										class="form-control" name="SysResFormMap.url"
										value="${resources.url}" />
								</div>
							</div>
						</c:if> --%>
						<c:if test="${parentResources.function_type=='0'}">
							<div class="form-group">
								<label id="lbSequence" class="col-xs-2 control-label">图&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;标</label>
								<div class="col-xs-8">
									<input id="txtSequence" maxlength="20" type="text"
										class="form-control" name="SysResFormMap.icon"
										required-message="图标格式不正确" check-type="required"
										value='${empty resources.icon?"fa fa-list":resources.icon}' />
								</div>
							</div>
						</c:if>



						<div class="form-group">
							<label id="lbSequence" class="col-xs-2 control-label">排&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;序</label>
							<div class="col-xs-8">
								<input id="txtSequence" maxlength="4" type="text"
									class="form-control" name="SysResFormMap.squence"
									required-message="请输入数字" check-type="required number"
									value="${resources.squence}" />
							</div>
						</div>

					<%-- 	<c:if test="${resources.function_type=='1'}">
							<div class="form-group">
								<label id="lbSequence" class="col-xs-2 control-label">图&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;标</label>
								<div class="col-xs-8">
									<input id="txtSequence" maxlength="20" type="text"
										class="form-control" name="SysResFormMap.icon"
										value="${resources.icon}" />
								</div>
							</div>
						</c:if> --%>



						<div class="form-group">
							<label id="lbStatus" class="col-xs-2 control-label">状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态</label>
							<div class="col-xs-8">
								<select id="dllStatus" class="form-control"
									name="SysResFormMap.state">
									<option value="0"
										<c:if test="${resources.state=='0'}">selected="selected"</c:if>>启用</option>
									<option value="1"
										<c:if test="${resources.state=='1'}">selected="selected"</c:if>>禁用</option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label id="lbDescription" class="col-xs-2 control-label">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述</label>
							<div class="col-xs-8">
								<textarea id="txtDescription" class="form-control"
									maxlength="100" rows="1" name="SysResFormMap.description">${resources.description}</textarea>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</body>
</html>